<!DOCTYPE html>
<html>
<head>
  <title>Webshop</title>
  <%= stylesheet_link_tag    "bootstrap.min", :media => "all" %>
  <%= stylesheet_link_tag    "bootstrap-responsive.min", :media => "all" %>
  <%= stylesheet_link_tag    "application", :media => "all" %>
  <%= javascript_include_tag "bootstrap.min" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
</head>
<body>
	
<div class="navbar">
  <div class="banner">
  	<%= image_tag("books_logo.jpg", id: 'logo') %>
  </div>
  
  <div class="language-switcher">
  	
  	  
  	
  	
	  <%= form_tag home_index_path, class: 'locale', :method=>'post' do %>
	  	<%= select_tag 'set_locale',
	  		options_for_select(LANGUAGES, I18n.locale.to_s),
	  		onchange: 'this.form.submit()' %>
	  	<%= submit_tag 'submit' %>
	  	<%= javascript_tag "$('.locale input').hide()" %>
	  <% end %>
  </div>
  
  <div class="feed">
  	<%= link_to image_tag("RSS.png", id: 'atom'), {:action => 'list', :controller => 'products', :id => "all",  :format => 'atom'} %>
  </div>
  
  
  <div class="navbar-inner">
    <a class="brand" href="#">WebShop</a>
    <ul class="nav">
      <li class="<%= (current_page?(:controller => 'home')?"active":"not") %>"><%= link_to t("link_home"), home_index_path %></li>
      <li class="<%= (current_page?(:controller => 'store')?"active":"not") %>"><%= link_to t("link_store"), store_index_path %></li>
    </ul>
    
  		<!--<input type="text" class="search-query" placeholder="Search">-->
  	<ul class="nav pull-right">
  	<% if session[:user_id] %>
		<li class="<%= (current_page?(:controller => 'admin')?"active":"not") %>"><%= link_to t("link_admin"), admin_url %></li>
		<li class="<%= (current_page?(:controller => 'categories')?"active":"not") %>"><%= link_to t("link_categories"), categories_url %></li>
		<li class="<%= (current_page?(:controller => 'products')?"active":"not") %>"><%= link_to t("link_products"), products_url %></li>
		<li class="<%= (current_page?(:controller => 'orders')?"active":"not") %>"><%= link_to t("link_orders"), orders_url %></li>
		<li class="<%= (current_page?(:controller => 'users')?"active":"not") %>"><%= link_to t("link_users"), users_url %></li>
		<li><%= link_to t("logout"), logout_path, method: :delete %></li>
	<% else %>
		<li><%= link_to t("login"), login_path %></li>
	<% end %>
	</ul>
  </div>
</div>

<div class="container">	
	<div class="row-fluid">
	  <div class="span12">
	  	<%= content_for?(:content) ? yield(:content) : yield %>
	  </div>
	</div>
</div>


</body>
</html>
	